{template 'common/header'}
<style>
	body{background:#EEE;}
	.container-fill{padding:.5em;}
	h4{margin:20px 0;}
	h4:first-of-type{margin-top:10px;}
	.panel{padding:.5em; margin-bottom:10px;}
	.nav.nav-tabs{margin-bottom:.8em;}
	.alert .form-group{margin-bottom:0;}
	label.form-group{display:block;}
	.steps{margin:10px 0;}
	.steps .fa{color:#428bca;}
	.steps .help-block{font-size:12px;}
	label.form-group{font-weight:normal; overflow:hidden; border-top:1px #DDD solid; padding-top:20px; }
	label.form-group input[name="type"]{opacity:0; width:0;}
</style>
<h4>订单信息</h4>
<div class="panel">
	<div class="clearfix" style="padding-top:10px;">
		<p>订单编号 :<span class="pull-right">{$params['ordersn']}</span></p>
		<p>商家名称 :<span class="pull-right">{$params['title']}</span></p>
		<p>支付金额 :<span class="pull-right">{php echo sprintf('%.2f', $params['fee']);}<span class="muted"> 元</span></span></p>
	</div>
</div>
<h4>选择支付方式</h4>
<ul class="nav nav-tabs" role="tablist" style="margin-bottom:0;">
	<li class="active"><a href="#direct" role="tab" data-toggle="tab" style="border-left:0;">微信支付</a></li>
</ul>
<div class="panel ng-container" ng-controller="loginPanel" style="border-top-left-radius:0; border-top-right-radius:0;">
	<div class="tab-content">
		<div class="tab-pane animated active fadeInLeft" id="direct">
			<div class="steps">
				<div class="row text-center">
					<div class="col-xs-6">
						<span class="fa-stack fa-2x">
							<i class="fa fa-adjust fa-stack-2x"></i>
						</span>
						<div class="help-block">付款给商家</div>
					</div>
					<div class="col-xs-6">
						<span class="fa-stack fa-2x">
							<i class="fa fa-circle-o fa-stack-2x"></i>
						</span>
						<div class="help-block">商家收款</div>
					</div>
				</div>
			</div>
			<div class="clearfix">
				{if !empty($pay['wechat']['switch'])}
				<label class="form-group">
					<div class="col-xs-2">
						<input type="radio" name="type" value="wechat" checked="true">
						<i class="fa fa-check-circle text-muted text-danger"></i>
					</div>
					<div class="col-xs-10">
						使用微信支付
						<div class="help-block">每笔最高1万, 每日限额1万</div>
					</div>
				</label>
				{/if}
			</div>
		</div>
	</div>
</div>
<input type="hidden" name="token" value="{$_W['token']}" />
<div class="pay-btn" id="wechat-panel">
	<form action="{php echo url('mc/cash/wechat');}" method="post">
		<input type="hidden" name="params" value="{php echo base64_encode(json_encode($params));}" />
		<button class="btn btn-warning btn-block btn-lg" type="submit" id="wBtn" value="wechat">微信支付</button>
	</form>
</div>
<script type="text/javascript">
	require(['jquery', 'util'], function($, u){
		$('input[name="type"]').click(function(){
			$('label.form-group .fa').removeClass('text-danger');
			$(this).parents('.form-group').find('.fa').addClass('text-danger');
			$('.pay-btn').hide();
			$('#'+$(this).val()+'-panel').show();
		});

		$('.nav li').click(function(){
			$('.pay-btn').hide();
			$('#default-panel').show();
			$('input[name="type"]').attr('checked',false);
		});
	});
</script>
{template 'common/footer'}